package cn.walls1717.wallsmall.product.dao;

import cn.walls1717.wallsmall.product.entity.AttrAttrgroupRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 属性&属性分组关联
 * 
 * @author walls1717
 * @email walls1717@163.com
 * @date 2022-10-21 11:26:47
 */
@Mapper
public interface AttrAttrgroupRelationDao extends BaseMapper<AttrAttrgroupRelationEntity> {

    /**
     * 根据属性分组id集合查询出属性id
     *
     * @param attrGroupIds 属性分组id集合
     * @return 属性id集合
     */
    List<Long> listAttrIdsByAttrGroupIds(@Param("attrGroupIds") List<Long> attrGroupIds);

    /**
     * 根据属性id(attrId)，分类id(catelogId)删除属性与属性分组关系
     *
     * @param attrAttrgroupRelations 属性与属性分组关系集合
     */
    void removeAttrAttrGroupRelationByAttrIdAndCatelogId(
        @Param("attrAttrgroupRelations") List<AttrAttrgroupRelationEntity> attrAttrgroupRelations);
}
